/*
 * Generated file. 
 * 
 * ViewMenu.java
 */
package xsp;

import com.ibm.xsp.page.compiled.AbstractCompiledPage;
import com.ibm.xsp.page.compiled.AbstractCompiledPageDispatcher;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import com.ibm.xsp.page.compiled.NoSuchComponentException;
import com.ibm.xsp.page.compiled.PageExpressionEvaluator;
import java.lang.String;
import com.ibm.xsp.component.UIViewRootEx2;
import com.ibm.xsp.extlib.component.outline.UIOutlineNavigator;
import com.ibm.xsp.extlib.tree.complex.PageTreeNode;

@SuppressWarnings("all")
public class ViewMenu extends AbstractCompiledPageDispatcher{
    
    public ViewMenu() {
        super("3.0");
    }

    protected AbstractCompiledPage createPage(int pageIndex) {
        return new ViewMenuPage();
    }
    
    protected boolean isCustomControl() {
        return true;
    }

    public static class ViewMenuPage extends AbstractCompiledPage {
        
        private static final ComponentInfo[] s_infos = new ComponentInfo[]{
            ComponentInfo.EMPTY_NORMAL, // 0 "outline"
            new ComponentInfo(false, new int[]{0}), // 1 view
        };
        
        public ViewMenuPage() {
            super(1, s_infos );
        }
        
        public int getComponentForId(String id) throws NoSuchComponentException { 
            if( "outline".equals(id) )
                return 0;
            return -1;
        }
        
        public UIComponent createComponent(int id, FacesContext context,
                UIComponent parent, PageExpressionEvaluator evaluator)
                throws NoSuchComponentException { 
            switch (id) {
            case 1:
                return createView(context, parent, evaluator);
            case 0:
                return createOutline(context, parent, evaluator);
            }
            throw new NoSuchComponentException(id);
        }
        
        private UIComponent createView(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            UIViewRootEx2 result = new UIViewRootEx2();
            initViewRoot(result);
            return result;
        }

        private UIComponent createOutline(FacesContext context, 
                UIComponent parent, PageExpressionEvaluator evaluator) {
            UIOutlineNavigator result = new UIOutlineNavigator();
            PageTreeNode treeNodes = new PageTreeNode();
            treeNodes.setComponent(result);
            treeNodes.setLabel("All Documents");
            treeNodes.setRole("navigation");
            treeNodes.setSelection("/allDocuments.xsp");
            treeNodes.setPage("/allDocuments.xsp");
            result.addNode(treeNodes);
            PageTreeNode treeNodes2 = new PageTreeNode();
            treeNodes2.setComponent(result);
            treeNodes2.setLabel("By Most Recent");
            treeNodes2.setRole("navigation");
            treeNodes2.setSelection("/byMostRecent.xsp");
            treeNodes2.setPage("/byMostRecent.xsp");
            result.addNode(treeNodes2);
            PageTreeNode treeNodes3 = new PageTreeNode();
            treeNodes3.setComponent(result);
            treeNodes3.setLabel("By Author");
            treeNodes3.setRole("navigation");
            treeNodes3.setSelection("/byAuthor.xsp");
            treeNodes3.setPage("/byAuthor.xsp");
            result.addNode(treeNodes3);
            PageTreeNode treeNodes4 = new PageTreeNode();
            treeNodes4.setComponent(result);
            treeNodes4.setLabel("By Tag");
            treeNodes4.setRole("navigation");
            treeNodes4.setSelection("/byTag.xsp");
            treeNodes4.setPage("/byTag.xsp");
            result.addNode(treeNodes4);
            PageTreeNode treeNodes5 = new PageTreeNode();
            treeNodes5.setComponent(result);
            treeNodes5.setLabel("My Documents");
            treeNodes5.setRole("navigation");
            treeNodes5.setSelection("/myDocuments.xsp");
            treeNodes5.setPage("/myDocuments.xsp");
            result.addNode(treeNodes5);
            setId(result, "outline");
            return result;
        }

    }
}
